#define _GLES_

#ifndef glTypes_h__
#define glTypes_h__


#include "./EGL/egl.h"
#include "./GLES/gl.h"
#include "./EGL/eglplatform.h"

#include "./glUtils.h"

#include "./OGLESTools.h"

#ifdef WINCE
	typedef PVR_Texture_Header PVRTextureHeader;
#else WIN32
	typedef PVRTextureHeaderV3 PVRTextureHeader;
#endif


namespace GLES
{
	typedef unsigned char   UChar;  
	typedef char            Int8;    
	typedef unsigned char   Uns8;  
	typedef short           Int16;                       
	typedef unsigned short  Uns16;                       
	typedef int             Int32;
	typedef unsigned        Uns32;
	typedef long long		Int64;
	typedef unsigned long long Uns64;

	typedef long           Long;
	typedef unsigned long  ULong;
	typedef double         Double;
	typedef float		   Float;

	typedef void           Void;
	typedef void *         VoidPtr;

	typedef BOOL		   Bool;
	typedef HRESULT		   Result;
	typedef wchar_t		   WChar;
	typedef char		   AChar;

	#ifdef UNICODE
		typedef wchar_t				Char;
		#define tmStrlen(str)		wcslen((wchar_t*)str)
		#define tmStrcmp(s1,s2)		wcscmp((wchar_t*)s1,(wchar_t*)s2)
		#define skyStrchr			wcsrchr
		#define  __S(str)			(Char*)L##str
		#define  __C(chr)			L##chr
	#else
		#define tmStrlen			strlen
		#define tmStrcmp			strcmp
		#define tmStrchr			strchr
		typedef char				Char;
		#define	 __S(str)			str
		#define  __C(str)			str
	#endif


		template <typename T>
		struct _Size
		{
			T w;
			T h;
			_Size(){}
			_Size(T W,T H):w(W),h(H){}
		};

		typedef struct _Size<Int32> SizeI;
		typedef struct _Size<Float> SizeF;

		template <typename T>
		struct _Rect
		{
			T x1;
			T y1;
			T x2;
			T y2;
			_Rect(T _x1,T _y1,T _x2,T _y2):
			x1(_x1),y1(_y1),x2(_x2),y2(_y2){}
			_Rect(){}
			Void set(T _x1,T _y1,T _x2,T _y2)
			{
				x1 = _x1;
				y1 = _y1;
				x2 = _x2;
				y2 = _y2;
			}
			T width(){return x2 - x1;}
			T height(){return y2 - y1;}
			struct _Size<T> getSize(){return _Size<T>(width(),height());}
		};

		typedef struct _Rect<Int32> RectI;
		typedef struct _Rect<Float> RectF;

		template <typename T>
		struct _Point
		{
			T x;
			T y;
			_Point(){}
			_Point(T X,T Y):x(X),y(Y){}
		};

		typedef struct _Point<Int32> PointI;
		typedef struct _Point<Float> PointF;

		template <typename T>
		struct _Vector2
		{
			T x;
			T y;
			_Vector2(){}
			_Vector2(T X,T Y):x(X),y(Y){}
		};
		typedef struct _Vector2<Int32> Vector2I;
		typedef struct _Vector2<Float> Vector2F;

		typedef struct _Vector3
		{
			Float x;
			Float y;
			Float z;
			_Vector3(){}
			_Vector3(Float X,Float Y,Float Z):x(X),y(Y),z(z){}
		}Vector3;

		typedef struct _Point3
		{
			Float x;
			Float y;
			Float z;
			_Point3(){}
			_Point3(Float X,Float Y,Float Z):x(X),y(Y),z(z){}
		}Point3;

		typedef struct _Color
		{
			Uns8 r;
			Uns8 g;
			Uns8 b;
			Uns8 a;
			_Color(Uns8 R,Uns8 G,Uns8 B,Uns8 A = 255):r(R),g(G),b(B),a(A){}
			_Color(){}
		}Color;
};
#include "./glUtil.h"
#endif // glTypes_h__

